
echo off
set appName=%2
set appNameWithEx=%3 
set resfolder=onefile

cls



exit



echo %1 %2 %3
cd %1
md %1%resfolder%
md %resfolder%\Resources\
md %recfolder%\actions\selenium\
md %recfolder%\actions\webaii\
del %resfolder%\Resources\*.* /Q /S
del %resfolder%\actions\selenium\*.* /Q /S
del %resfolder%\actions\webaii\*.* /Q /S
del %resfolder%\actions\*.* /Q /S
del %resfolder%\*.dll /Q /S
del %resfolder%\*.pdb /Q /S
del %resfolder%\*.exe /Q /S

xcopy *.dll %resfolder%\ /Y /C /I /Q /R
xcopy *.pdb %resfolder%\ /Y /C /I /Q /R
xcopy *driver*.exe %resfolder%\ /Y /C /I /Q /R
xcopy %2.exe %resfolder%\ /Y /C /I /Q /R
xcopy %1\..\..\Resources\*.* %1%resfolder%\Resources\*.*  /C /I /Q /R

xcopy *.selenium.dll %resfolder%\actions\selenium\  /Y /I /R /F
xcopy *.webaii.dll %resfolder%\actions\webaii\ /Y /I /R /F

del %resfolder%\%2.dll /Q /S
del %resfolder%\*actions.*.dll /Q 

cd %1%resfolder%



echo merging...
echo "C:\Program Files\Microsoft\ILMerge\ilmerge.exe" /lib:%windir%\Microsoft.NET\Framework\v4.0.30319 /lib:"%programfiles%\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies" /targetplatform:v4 /closed /ndebug /wildcards /out:%3.exe %2.exe *.dll

"C:\Program Files\Microsoft\ILMerge\ilmerge.exe" /lib:%windir%\Microsoft.NET\Framework\v4.0.30319 /lib:"%programfiles%\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies" /targetplatform:v4 /closed /wildcards /out:%3.exe %2.exe *.dll
echo merging been completed
echo result could be found here: %1%resfolder%\
xcopy %3.pdb actions\ /Y /I /Q /F
echo OFF
del *.pdb /Q 
del *.dll /Q
del %2.exe /Q
del %resfolder%\Resources\*.* /Q /S
xcopy actions\%3.pdb *.* /Y /I /Q /F
cd %1
cls
echo on
